package com.ayi.servlet.backstage; /**
 * @author Ayingzz
 * @create 2021/12/6 21:14
 */

import com.ayi.bean.User;
import com.ayi.dao.bookdao.QueryBook;
import com.ayi.dao.cartdao.QueryCart;
import com.ayi.dao.userdao.QueryUser;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "showCartServlet", value = "/showCartServlet")
public class showCartServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 购物车
        request.getSession().setAttribute("userCartList", new QueryCart().queryCartByUsername(request.getParameter("username")));

        // 待匹配购物车
        request.getSession().setAttribute("booksWillSelectedIntoShowCart", new QueryBook().queryBooksIntoCartSettingNum(request.getParameter("username")));

        request.getRequestDispatcher("cartShow.jsp").forward(request, response);
    }

}
